package cl.blueprintsit.utils.files;

import cl.blueprintsit.utils.pdf.PDFUtils;
import org.junit.Test;

import java.io.File;

import static junit.framework.Assert.assertNotNull;

/**
 * Created with IntelliJ IDEA.
 * User: afarias
 * Date: 11/6/13
 * Time: 8:25 AM
 * To change this template use File | Settings | File Templates.
 */
public class PDFUtilsTest {


    @Test
    public void testProtectPDF() throws Exception {
        File pdf = new File("/Users/afarias/IdeaProjects/MetLife Services/DocumentService/src-test/resources/soa-book.pdf");
        File finalPDF = new File("/Users/afarias/IdeaProjects/MetLife Services/DocumentService/src-test/resources/soa-book-passw.pdf");

        finalPDF = PDFUtils.protectPDF(pdf, finalPDF, "af");
        boolean newFile = finalPDF.createNewFile();
        if (finalPDF.exists()){
            System.out.println("It does not exists!");
        }

        assertNotNull(finalPDF);
    }

    /*@Test
    public void testDoc2pdf() throws Exception {

        File theFile = new File("/Users/afarias/IdeaProjects/MetLife Services/DocumentService/src-test/resources/cert.docx");
        File out = PDFUtils.doc2pdf(theFile);

        System.out.print("Path: " + out.getAbsolutePath());
    }*/
}
